package com.zoro.dyformservice.business.user.entity;

import com.zoro.dyformservice.constants.response.common.Sex;
import jakarta.persistence.*;

import java.util.Date;

@Entity
@Table(name = "df_user_info_ext")
public class UserInfoExtEntity {

    @Id
    @Column(name = "id")
    private String id;

    @Column(name = "sex_code")
    private Sex sexCode;

    @Column(name = "birthday")
    private Date birthday;

    @ManyToOne
    @JoinColumn(name = "ethnic_id")
    private EthnicInfoEntity ethnicInfo;
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private UserInfoEntity userInfo;


    public EthnicInfoEntity getEthnicInfo() {
        return ethnicInfo;
    }

    public void setEthnicInfo(EthnicInfoEntity ethnicInfo) {
        this.ethnicInfo = ethnicInfo;
    }
    public UserInfoEntity getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfoEntity userInfo) {
        this.userInfo = userInfo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public Sex getSexCode() {
        return sexCode;
    }

    public void setSexCode(Sex sexCode) {
        this.sexCode = sexCode;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Override
    public String toString() {
        return "UserInfoExtEntity{" +
                "id='" + id + '\'' +
                ", sexCode=" + sexCode +
                ", birthday=" + birthday +
                ", birthday=" + birthday +
                ", ethnicInfo=" + ethnicInfo +
                '}';
    }
}
